<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="email=no" name="format-detection"/>
    <meta content="telephone=no" name="format-detection" />
    <link href="/Public/css/layout.css" type="text/css" rel="stylesheet" >
    <script src="/Public/js/jquery-1.10.1.min.js"></script>
</head>
<body>
<div class="head">
    <div class="head-cont"> <a href="javascript:history.back();">
        <i class="icon-iconfont-fanhui1"></i></a>
        <span class="head-tit">
            <?php if($cate_type === 'departments'){ ?>
            科室找药
            <?php }else{ ?>
            部位找药
            <?php } ?>
        </span> </div>
</div>
<div class="cate-left">
    <div class="h45"></div>
    <ul class="cate-ul">
        <?php foreach($cate_info[$cate_type] as $k => $v){ ?>
        <li id="<?php echo ($v); ?>"><a href="javascript:;"><?php echo ($v); ?></a></li>
        <?php } ?>
    </ul>
</div>
<div class="cate-right">
    <div class="h45"></div>
    <div class="cate-con">
        <ul>
            <?php foreach($cate_info['disease'] as $ka=>$va){ ?>
            <li><a href="/search/<?php echo ($va); ?>"><?php echo ($va); ?></a></li>
            <?php } ?>

        </ul>
    </div>
</div>


</body>
<script>
    $(function(){
        $('.cate-ul li').eq(0).addClass('select');

        $('.cate-ul li').on('click',function(){
            $(this).addClass('select').siblings().removeClass('select');
            var id = $(this).attr('id');
            var append_ul = $('.cate-right ul');
            //ajax请求，获取信息
            $.ajax({
                url:'/category/<?php echo ($cate_type); ?>/'+ id +'?access=xhr',
                type:'get',
                dataType:'json',
                beforeSend:function(){
                    append_ul.empty().append('<li class="know-li" id="loading" style="text-align: center"><img src="/Public/images/loading.gif">正在加载中.....</li>')
                },
                success:function(msg){
                    if(msg.code == 200){
                        var lis = '';
                        for(i = 0; i < msg.info.length; i++){
                            var info = msg.info[i];
                            lis += '<li><a href="/search/'+info+'">'+info+'</a></li>'
                        }
                        append_ul.empty().append(lis);
                    }
                }
            });
        });
    })
</script>
</html>